
package com.insigma.business.qrcode.common.util;


import com.insigma.business.qrcode.common.dto.ErrorCodeEnum;

public class BizException extends RpcBizException {

    
    private static final long serialVersionUID = 6786298895263007770L;

    
    protected ScenarioCodeEnum resultScenarioEnum;

    
    protected ErrorCodeEnum errorCodeEnum;

    protected String errorMsg;

    
    protected BizException() {
    }

    
    public BizException(ErrorCodeEnum resultDetailEnum) {
        super(resultDetailEnum.getDesc());
        this.errorCodeEnum = resultDetailEnum;
        this.errorMsg = resultDetailEnum.getDesc();
    }

    
    public BizException(ErrorCodeEnum resultDetailEnum, String msg) {
        super(msg);
        this.errorCodeEnum = resultDetailEnum;
        this.errorMsg = msg;
    }

    
    public BizException(ScenarioCodeEnum resultScenarioEnum,
                        ErrorCodeEnum resultDetailEnum) {
        this.resultScenarioEnum = resultScenarioEnum;
        this.errorCodeEnum = resultDetailEnum;
        this.errorMsg = resultDetailEnum.getDesc();
    }

    
    public BizException(ScenarioCodeEnum resultScenarioEnum,
                        ErrorCodeEnum resultDetailEnum, String msg) {
        super(msg);
        this.resultScenarioEnum = resultScenarioEnum;
        this.errorCodeEnum = resultDetailEnum;
        this.errorMsg = msg;
    }

    
    public BizException(ScenarioCodeEnum resultScenarioEnum,
                        ErrorCodeEnum errorCodeEnum, Throwable cause) {
        super(cause);
        this.resultScenarioEnum = resultScenarioEnum;
        this.errorCodeEnum = errorCodeEnum;
        this.errorMsg = errorCodeEnum.getDesc();
    }

    
    public BizException(String message, Throwable cause) {

        super(message, cause);
    }

    


    public ScenarioCodeEnum getResultScenarioEnum() {
        return resultScenarioEnum;
    }

    public ErrorCodeEnum getErrorCodeEnum() {
        return errorCodeEnum;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
